home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 256 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.9 KB

  1. Path: queeg.apci.net!news
  2. From: Poconnor@apci.net   (James O'Connor)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: assembler in borland C 4.5
  5. Date: 3 Jan 1996 12:52:46 GMT
  6. Organization: Applied Personal Computing, Inc.
  7. Message-ID: <4cdu6u$ou4@queeg.apci.net>
  8. References: <4cccb4$6kg@news1.usa.pipeline.com>
  9. Reply-To: oconnor@apci.net
  10. NNTP-Posting-Host: dialup14.apci.net
  11. X-Newsreader: IBM NewsReader/2 v1.2
  12.  
  13. In <4cccb4$6kg@news1.usa.pipeline.com>, grantp@usa.pipeline.com(Pete) writes:
  14. >On Jan 02, 1996 14:08:40 in article <assembler in borland C 4.5>, 'Per
  15. >Wiberg <e95_pwi@elixir.e.kth.se>' wrote: 
  16. >>Well.. I got a CD with a lot of programs from my school (KTH in 
  17. >>stockholm) and among them BC4.5. AND no manual, reference-book or 
  18. >>anything!. 
  19. >>"lucky-me" I've got no CD-ROM drive! ... so I made my friend raw-copy 
  20. >>BC4.5 on to floppy's (bad idea!). And here I am with a silly question: 
  21. >> 
  22. >Hmm, I don'w see what the above has to do with the question. 
  23. >>- how do you include assembler code in BC4.5 ? 
  24. >If you mean inline assembly (which is only a subset of ASM), it goes 
  25. >something like this: 
  26. >int Foo (int n) 
  27. > { 
  28. >   asm { 
  29. >            mov   ax,n 
  30. >            add   ax,5 
  31. >        } 
  32. > } 
  33. >Some not-so-apparent rules are: 
  34. >   the enclosed braces (at least the first one) must be on a line 
  35. >   that doesn't contain any ASM directives. 
  36. >  There's restrictions on comments.  I don't remember the rules 
  37. >but to be safe, don't use any. 
  38. >If you make errors, the compiler sometimes reports errors in 
  39. >a completely different place from the actual error and the message 
  40. >is gobbdleygook -- moral:  Don't make any errors in your asm code. :-) 
  41. >-- 
  42. >Pete
  43. Uh....if we never made erroes in asm code, would we need high order languages
  44.  like C, C++, Smalltalk, etc...?
  45.  
  46. James O'Connor
  47. Framework Technologies
  48. oconnor@apci.net
  49.  
  50. "If your nose runs and your feet smell,
  51.  you're built upside down"
  52.  
  53.